//
//  MLASavePinBillCell.m
//  MagicLampApp
//
//  Created by Zheng on 2018/12/24.
//  Copyright © 2018 zheng.magic.lamp.app. All rights reserved.
//

#import "MLASavePinBillCell.h"
#import "MLASavePinBillModel.h"

@interface MLASavePinBillCell ()

@end

@implementation MLASavePinBillCell {

    UILabel *cateLbl;
    UILabel *nameLbl;
    UILabel *moneyLbl;
    
    UILabel *dateLbl;
    UILabel *buyerLbl;
    UILabel *checkLbl;
}

- (void)setModel:(MLASavePinBillModel *)model {
    _model = model;
    
    cateLbl.text = [NSString stringWithFormat:@"类型：%@",_model.type];
    nameLbl.text = [NSString stringWithFormat:@"事项：%@",_model.title];
    moneyLbl.text = [NSString stringWithFormat:@"金额：%@元",_model.price];
    dateLbl.text = _model.ctime;
    buyerLbl.text = [NSString stringWithFormat:@"持票人：%@",_model.holder];
    checkLbl.text = [NSString stringWithFormat:@"审核人：%@",_model.check];

}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        cateLbl = [[UILabel alloc] init];
        cateLbl.font = CX_GetNormalFont(12);
        cateLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:cateLbl];
        [cateLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.mas_equalTo(20);
        }];

        nameLbl = [[UILabel alloc] init];
        nameLbl.font = CX_GetNormalFont(12);
        nameLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:nameLbl];
        [nameLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->cateLbl.mas_bottom).offset(8);
        }];
        
        moneyLbl = [[UILabel alloc] init];
        moneyLbl.font = CX_GetNormalFont(12);
        moneyLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:moneyLbl];
        [moneyLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.top.equalTo(self->nameLbl.mas_bottom).offset(8);
        }];
        
        dateLbl = [[UILabel alloc] init];
        dateLbl.textColor = CX_GetColorHex(0x999999, 1);
        dateLbl.font = CX_GetNormalFont(10);
        [self.shadowView addSubview:dateLbl];
        [dateLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->cateLbl);
        }];
        
        buyerLbl = [[UILabel alloc] init];
        buyerLbl.font = CX_GetNormalFont(12);
        buyerLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:buyerLbl];
        [buyerLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->nameLbl);
        }];
        
        checkLbl = [[UILabel alloc] init];
        checkLbl.font = CX_GetNormalFont(12);
        checkLbl.textColor = CX_GetColorTitle();
        [self.shadowView addSubview:checkLbl];
        [checkLbl mas_remakeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-15);
            make.centerY.equalTo(self->moneyLbl);
        }];
        
        /*
         cateLbl.text = @"类型：票据";
         nameLbl.text = @"事项：采购钢笔发票";
         moneyLbl.text = @"金额：3000";
         dateLbl.text = @"2018.9.9 12：21";
         buyerLbl.text = @"采购人：张三";
         checkLbl.text = @"核验人：李四";
         */
    }
    return self;
}

@end
